<template>
  <div id="app">
    <banner></banner>
    <tab></tab>
    <router-view/>
  </div>
</template>

<script>
import {mapState,mapMutations } from "vuex";
import tab from "./components/Tab/tab";
import banner from './components/Banner/banner'
export default {
  name: "App",
  components: {
    tab,banner
  },
  created() {
    console.log("此时的课程id为：" + this.$route.params);
    this.setCourseId(this.$route.params.courseId);
    // this.$axios
    //   .get("https://www.easy-mock.com/mock/5b0266d995118136368f1a78/vuezhixin")
    //   .then((res)=> {
    //     console.log(res);

    //       this.setCourseId(res.data.data.courseId);
    //     // this.$nextTick(() => {
    //     //   this.setCourseId(res.data.data.courseId);
    //     // });
    //   })
    //   .catch(error => {
    //     alert("error:" + error);
    //   });
  },
  methods: {
    ...mapMutations(["setCourseId"]),
  }
};
</script>

<style>
</style>
